package com.tal.bcc.pad.cloud.coreprogress;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;

public class ProgressHelper {
    public ProgressHelper() {
    }

    public static RequestBody withProgress(RequestBody requestBody, ProgressListener progressListener) {
        if (requestBody == null) {
            throw new IllegalArgumentException("requestBody == null");
        } else if (progressListener == null) {
            throw new IllegalArgumentException("progressListener == null");
        } else {
            return new ProgressRequestBody(requestBody, progressListener);
        }
    }

    public static ResponseBody withProgress(ResponseBody responseBody, ProgressListener progressListener) {
        if (responseBody == null) {
            throw new IllegalArgumentException("responseBody == null");
        } else if (progressListener == null) {
            throw new IllegalArgumentException("progressListener == null");
        } else {
            return new ProgressResponseBody(responseBody, progressListener);
        }
    }
}
